package org.dtrd.modules.record.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.record.entity.bean.UricacidDetail;

import java.util.Date;


/**
 * <p>
 * 尿酸记录表
 * </p>
 *
 * @author xiao
 * @since 2022-01-13
 */
@Getter
@Setter
@TableName("dtrd_ent_rd_signin_uricacid")
public class DtrdEntRdSigninUricacid {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    @TableField("create_time")
    private Date createTime;

    /**
     * 0 正常 1 删除
     */
    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    @TableField("patient_id")
    private Integer patientId;

    /**
     * 记录日期  yyyy-MM-dd
     */
    @TableField("record_date")
    private Date recordDate;

    /**
     * 记录时间 yyyy-MM-dd HH:mm:ss
     */
    @TableField("record_time")
    private Date recordTime;

    /**
     * 记录状态  0:正常 1:偏低 2:偏高 3:未设置
     */
    @TableField("record_status")
    private Integer recordStatus;

    /**
     * 记录值
     */
    @TableField("record_value")
    private Float recordValue;

    public DtrdEntRdSigninUricacid init() {
        createTime = new Date();
        isDel = 0;
        return this;
    }

    public DtrdEntRdSigninUricacid parseFromDto(UricacidDetail dto) {
        dataId = dto.getDataId();
        patientId = dto.getPatientId();
        recordDate = dto.getRecordDate();
        recordTime = dto.getRecordTime();
        recordStatus = dto.getRecordStatus();
        recordValue = dto.getRecordValue();
        return this;
    }


}
